From: Keir Fraser Date: Tue, 28 Jul 2009 15:16:32 +0000 (+0100) Subject: xend: pass-through: Use parse_pci_name() in find_parent() X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13555 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=2c701424fd2828bf0c997a27543bf8023328efa8;p=xen.git xend: pass-through: Use parse_pci_name() in find_parent() Signed-off-by: Simon Horman --- diff --git a/tools/python/xen/util/pci.py b/tools/python/xen/util/pci.py index b7e34da36d..55077e5c1b 100644 --- a/tools/python/xen/util/pci.py +++ b/tools/python/xen/util/pci.py @@ -633,16 +633,7 @@ class PciDevice: if parent[0:3] == 'pci': # We have reached the upmost one. return None - else: - dev = {} - lst = parent.split(':') - dev['domain'] = '%04x' % int(lst[0], 16) - dev['bus'] = '%02x' % int(lst[1], 16) - lst = lst[2] - lst = lst.split('.') - dev['slot'] = '%02x' % int(lst[0], 16) - dev['func'] = '%x' % int(lst[1], 16) - return dev + return parse_pci_name(parent) except OSError, (errno, strerr): raise PciDeviceParseError('Can not locate the parent of %s', self.name)